import { defHttp } from '/@/utils/http/axios';
import {
  ServiceModel,
  ServicePageParams,
  ServicePageListGetResultModel,
} from '/@/extendModel/agreementModel';
enum Api {
  ADD = '/protocol/create_gateway_protocol',
  EDITE = '/protocol/update_gateway_protocol',
  GET_SERVICE_LIST = '/protocol/query_gateway_protocol',
}

//添加
export const addAgreementApi = (data: ServiceModel) =>
  defHttp.post({ url: Api.ADD, data });
  //修改
export const editAgreementApi = (data: ServiceModel) =>
  defHttp.patch<ServiceModel[]>({ url: Api.EDITE, data });

//列表
export const getAgreementListByPage = (params?: ServicePageParams) =>
  defHttp.get<ServicePageListGetResultModel>({ url: Api.GET_SERVICE_LIST, params });
